/**
 * api管理
 */
import request from './../utils/request'
export default {
    // 登录接口
    login(params) {
        return request({
            url: '/users/login',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取本月登录记录和上月登录记录
    getUserLoginCount() {
        return request({
            url: '/userLogins/count',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 获取全部菜单列表
    getMenuList(params) {
        return request({
            url: '/menu/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取菜单权限列表
    getPermissionList() {
        return request({
            url: '/users/getPermissionList',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 获取用户列表
    getUserList(params) {
        return request({
            url: '/users/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取所有用户列表
    getAllUserList() {
        return request({
            url: '/users/all/list',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 删除用户
    userDel(params) {
        return request({
            url: '/users/delete',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 用户密码重置
    userPwdReset(params) {
        return request({
            url: '/users/pwdReset',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取所有角色列表
    getRoleAllList() {
        return request({
            url: '/roles/allList',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 获取角色列表
    getRoleList(params) {
        return request({
            url: '/roles/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取部门列表
    getDeptList(params) {
        return request({
            url: '/dept/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 部门操作
    deptOperate(params) {
        return request({
            url: '/dept/operate',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 用户提交接口
    userSubmit(params) {
        return request({
            url: '/users/operate',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取当前用户信息
    getCurrentUserInfo() {
        return request({
            url: '/users/current',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 更新当前用户信息
    updateUserInfo(params) {
        return request({
            url: '/users/updateCurrent',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 修改密码
    changePassword(params) {
        return request({
            url: '/users/changePassword',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 菜单提交接口
    menuSubmit(params) {
        return request({
            url: '/menu/operate',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 新增获取 MBR 列表的方法
    getMbrList(params) {
        return request({
            url: '/mbrs/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 新增获取 MBR 总数
    getMbrCount() {
        return request({
            url: '/mbrs/count',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 角色操作接口
    roleOperate(params) {
        return request({
            url: '/roles/operate',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 角色权限更新接口
    updatePermission(params) {
        return request({
            url: '/roles/update/permission',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取报销单列表
    getRbList(params) {
        return request({
            url: '/rb/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取诈骗报销单列表
    getRbFraudCount() {
        return request({
            url: '/rb/fraudCount',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 报销单加入审查
    rbAddReview(params) {
        return request({
            url: '/rb/addReview',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 报销单归档 
    rbArchive(params) {
        return request({
            url: '/rb/archive',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 报销单删除
    rbDel(params) {
        return request({
            url: '/rb/delete',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 报销单提交接口
    rbSubmit(params) {
        return request({
            url: '/rb/operate',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取报销单上月总数量和本月总数量
    getRbCount() {
        return request({
            url: '/rb/count',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 获取上传记录
    getUploadRecords() {
        return request({
            url: '/upload/records',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 上传文件
    uploadXlsx(params) {
        return request({
            url: '/process_xlsx/',
            method: 'post',
            data: params,
            mode: 'modelApi'
        })
    },
    // 下载文件
    downloadFile(folderPath, fileName) {
        return request({
            url: `/download/${folderPath}/${fileName}`,
            method: 'get',
            mode: 'modelApi'
        });
    },
    // 获取属于最近五次上传的报销单的诈骗与非诈骗数量
    getRecentUploadRbFraudCount() {
        return request({
            url: '/rb/recentFraudCount',
            method: 'get',
            data: {},
            mode: 'baseApi'
        })
    },
    // 获取审查单列表
    getReviewList(params) {
        return request({
            url: '/review/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 审查报错
    reviewSave(params) {
        return request({
            url: '/review/save',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 删除审查单
    reviewDel(params) {
        return request({
            url: '/review/delete',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 提交审查
    reviewSubmit(params) {
        return request({
            url: '/review/submit',
            method: 'post',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取审查记录列表
    getReviewRecordList(params) {
        return request({
            url: '/reviewRecord/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
    // 获取归档记录列表
    getArchiveList(params) {
        return request({
            url: '/rbarchive/list',
            method: 'get',
            data: params,
            mode: 'baseApi'
        })
    },
}